package vip.liux.contracts.repositories.pay;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.ListCrudRepository;
import org.springframework.data.repository.ListPagingAndSortingRepository;
import org.springframework.data.repository.NoRepositoryBean;
import vip.liux.contracts.models.pay.PayNotifyTask;
import vip.liux.contracts.shared.enums.pay.PayNotifyStatus;
import vip.liux.contracts.shared.enums.pay.PayNotifyType;

import java.time.LocalDateTime;
import java.util.List;

@NoRepositoryBean
public interface PayNotifyTaskRepository extends ListPagingAndSortingRepository<PayNotifyTask, Long>, ListCrudRepository<PayNotifyTask, Long> {
    List<PayNotifyTask> selectListByNotify();

    void updateLastExecuteTimeAndNotifyTimesAndStatusById(LocalDateTime lastExecuteTime, Integer notifyTimes, PayNotifyStatus status, Long id);

    Page<PayNotifyTask> findPage(
            Long appId, PayNotifyType type, String dataNo, PayNotifyStatus status, String merchantOrderId, String merchantRefundId,
            String merchantTransferId, LocalDateTime start, LocalDateTime end, Pageable page);
}